package com.shuyun.springboot.amqp;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * Created by feng.ding on 2017/1/11.
 */
/*@SpringBootApplication
public class AmqpApp implements CommandLineRunner {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Bean
    public Queue queue(){
        return new Queue("my-queue");
    }

    @Override
    public void run(String... strings) throws Exception {
        rabbitTemplate.convertAndSend("my-queue", "一条RabbitMQ的消息");
    }

    public static void main(String[] args) {
        SpringApplication.run(AmqpApp.class, args);
    }
}*/
